# Contributor: Jakob Meier <comcloudway@ccw.icu>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>
pkgname=py3-pure_protobuf
# Also needs to be updated in the use_fixed_version.patch
pkgver=3.1.2
pkgrel=0
pkgdesc="Python implementation of Protocol Buffers with dataclass-based schemaʼs "
url="https://pypi.org/project/pure-protobuf/"
arch="noarch"
license="MIT"
depends="py3-typing-extensions"
makedepends="
py3-gpep517
py3-hatchling
py3-poetry-core
py3-wheel
py3-setuptools
"
checkdepends="
py3-pydantic
py3-pytest
py3-pytest-benchmark
py3-pytest-cov
"
subpackages="$pkgname-pyc"
source="
	https://github.com/eigenein/protobuf/archive/$pkgver/protobuf-$pkgver.tar.gz
	use_fixed_version.patch
"
builddir="$srcdir/protobuf-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
}

sha512sums="
cbb71547e88fb0895da0e1dbbdd7abcbe6152f17a2f2973226c05e447e80386bd8e96ac0d2f661eebdb09acf04e413d1a8c11ba875679bdabf815774e01dd1fb  protobuf-3.1.2.tar.gz
6b7941c142b3051843097b4cdf30419d58133ec9bd9f33584d6cb1c899d4ed0b4ab729f5eb5407feed731da044f028045d6657ae4b77e88ca45e13cf83961b05  use_fixed_version.patch
"
